<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>404</title>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.min.css}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<div class="middle-box text-center animated fadeInDown">
    <h1>404</h1>
    <h3 class="font-bold">对不起，您没有切换站点，无法展示站点数据！</h3>
    <div>
        <select id="shopSwitch" name="shopId" th:with="shopList=${shopList}" class="form-control">
            <option th:each="shop:${shopList}" th:value="${shop.id}"
                    th:text="${shop.shopName}" th:selected="${shopId==shop.id}"></option>
        </select>
    </div>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:inline="javascript">
    var ctx = [[@{/}]];
    //dev-append
    $('select[name="shopId"]').change(function () {
        switchShop($(this).val());
    });
    //dev-append 店铺
    function switchShop(shopId) {
        $.ajax({
            type: 'POST',
            url: ctx + 'back/shop/switch',
            data: {
                shopId: shopId
            },
            success: function (result) {
                top.location.reload()
            },
            error: function (result) {
                top.location.reload()
            }
        });
    }
</script>
</body>
</html>
